package com.coupon.couponbatchsend100w;

import jakarta.annotation.PostConstruct;
import jakarta.annotation.Resource;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

@SpringBootApplication
public class CouponBatchSend100wApplication {
    @Resource
    private ThreadPoolTaskExecutor threadPool;

    @PostConstruct
    public void getThreadPoolConfig(){
//        扫描配置：
        System.out.println("---------threadPool getCorePoolSize: "+threadPool.getCorePoolSize());
        System.out.println("---------threadPool getMaxPoolSize: "+threadPool.getMaxPoolSize());
        System.out.println("---------threadPool getQueueCapacity: "+threadPool.getQueueCapacity());
        System.out.println("---------threadPool getKeepAliveSecond: "+threadPool.getKeepAliveSeconds());
//        返回java虚拟机可以使用的处理器核心数量：
        System.out.println("---------threadPool getAvailableProcessors: "+Runtime.getRuntime().availableProcessors());

    }

    public static void main(String[] args) {
        SpringApplication.run(CouponBatchSend100wApplication.class, args);
    }

}
